def delAttribute(name, node):
    if(name in node.attrib): del node.attrib[name]
        
def creatOrDelete(name, node, option, default):
    if(option!=default): 
        node.set(name, str(option)) 
    else:
        delAttribute(name, node)